<template>
    <div>
        <div
            style="display: flex; width: 800px; height: 40px; line-height: 40px"
        >
            <span style="color: red">*</span><span>角色名称</span>
            <el-input v-model="addvalue"></el-input>
        </div>
        <div style="margin-top:10px;margin-left:40px">
            <el-button @click="addRole" type="primary" style="margin-right:20px">保存</el-button>
            <router-link to="/Home/RoleList"><el-button type="info">取消</el-button></router-link>
        </div>
    </div>
</template>

<script>
export default {
    data(){
        return{
            addvalue:''
        }
    },
    methods:{
        //新增角色
        async addRole(){
            const res = await this.api.role.addRole({
                roleName:this.addvalue
            });
            console.log(res)
        }
    }
};
</script>

<style lang="scss" scoped>
.el-input {
    width: 600px;
    margin-left: 10px;
}
</style>